package com.renren.rrwx.model;

import com.renren.mobile.rmsdk.friends.GetFriendsResponse.FriendItem;

/**
 * 用于创建Hero的工厂类
 * 
 * @author Leon
 * 
 */
public class HeroFactory {

	/**
	 * 不同的Hero类型用不同的Name来区别
	 */
	public final static int HERO_PLAYER = 1;
	public final static int HERO_FRIEND = 2;

	public static Hero create(int type, long id, String name) {

		switch (type) {
		case HERO_PLAYER: {
			return new PlayerHero(id, name);
		}
		case HERO_FRIEND: {
			return new Hero(id, name);
		}
		}
		return null;
	}

	public static Hero create(int type, FriendItem f) {
		Hero h = create(type, f.getUserId(), f.getUserName());
		h.setGender(f.getGender());
		
		h.setHeadImgUrl(f.getHeadUrl());
		return h;

	}
}
